<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background:#faad;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1>{{message}}</h1>
        <div class="box" v-on:click="divclick"></div>
        <h2>{{counter}}</h2>
        <button @click="clickcounter">+1</button>
        <!-- 绑定其他方法 -->
        <!-- 绑定多个事件 -->
        <!-- <div class="box" @click="divclick" @mousemove="divmousemove"></div> -->
        <div class="box" v-on="{click:divclick,mousemove:divmousemove}"></div>
    </div>
    <script src="https://unpkg.com/vue@next"></script>
    <script>
        //用vue创建app
        const app=Vue.createApp({
            data:function(){
                return{
                    message:"Hello world",
                    counter:0
                }
            },
            methods:{
                divclick(){
                    console.log("divclick");
                },
                clickcounter(){
                    this.counter++
                },
                divmousemove(){
                    console.log("divmousemove");
                }
            }
        })
        //挂载app
        app.mount("#app")
    </script>

</body>
</html>